package com.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.item.dao.WxSysLogMapper;
import com.item.exception.common.CustomException;
import com.item.entity.WxSysLog;
import com.item.service.WxSysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class WxSysLogServiceImpl extends ServiceImpl<WxSysLogMapper, WxSysLog> implements WxSysLogService {

    @Autowired
    WxSysLogMapper wxSysLogMapper;

    @Override
    @Async("activeExecutor")
    public void saveLogs(WxSysLog sysLog) {

        int i = wxSysLogMapper.insert(sysLog);

        if (i<=0){
            throw new CustomException("日志保存失败");
        }
    }
}
